Skip to content

Few optimizations#2432

Closed
marijaselakovic wants to merge 1 commit into
socketio:masterfrom
marijaselakovic:master
Closed

Few optimizations#2432
marijaselakovic wants to merge 1 commit into
socketio:masterfrom
marijaselakovic:master

Conversation

@marijaselakovic
Copy link
Copy Markdown

I suggest to replace for in loop with hasOwnProperty check with significantly cheaper Object.keys and for loop (jsperf: https://jsperf.com/object-keys-vs-for-in-perf). In String.prototype.of method you call String constructor which usually receives some string as an input. It is cheaper to use implicit string conversion, and performance benefit is even larger for inputs of type string (jsperf: http://jsperf.com/implicitstringconversion)

@darrachequesne
Copy link
Copy Markdown
Member

nsps hash will be replaced by a Map starting 2.x. Thanks though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants